package schema;

import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
import org.w3c.dom.Element;

/**
 * Created by Administrator on 2017/6/30.
 */
public class PeopleBeandefinitionParser extends AbstractSingleBeanDefinitionParser {
    @Override
    protected Class<?> getBeanClass(Element element) {
        return PeopleBean.class;
    }


    @Override
    protected void doParse(Element element, BeanDefinitionBuilder builder) {
     String id = element.getAttribute("id");
     String age = element.getAttribute("age");
     String name = element.getAttribute("name");
     builder.addPropertyValue("id",id);
     builder.addPropertyValue("age",Integer.valueOf(age));
     builder.addPropertyValue("name",name);

    }
}
